<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>uCXpresso.BLE: bleProximity Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../upnp.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">uCXpresso.BLE
   &#160;<span id="projectnumber">v1.0.4</span>
   </div>
   <div id="projectbrief">RTOS C++ Framework for Bluetooth Low Energy</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="../../classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="../../hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="../../functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('de/d67/classble_proximity.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="../../db/dcc/classble_proximity-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">bleProximity Class Reference<div class="ingroups"><a class="el" href="../../df/daf/group___b_l_e.html">BLE</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &quot;<a class="el" href="../../de/d8a/ble__proximity_8h_source.html">class/ble_proximity.h</a>&quot;</code></p>
<div class="dynheader">
Inheritance diagram for bleProximity:</div>
<div class="dyncontent">
 <div class="center">
  <img src="../../de/d67/classble_proximity.png" usemap="#bleProximity_map" alt=""/>
  <map id="bleProximity_map" name="bleProximity_map">
<area href="../../d9/db6/class_c_peripheral.html" alt="CPeripheral" shape="rect" coords="0,56,80,80"/>
<area href="../../dc/dac/class_c_object.html" alt="CObject" shape="rect" coords="0,0,80,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3cbf3bd31cac77037d623ef9c8098a71"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d67/classble_proximity.html#a3cbf3bd31cac77037d623ef9c8098a71">bleProximity</a> (<a class="el" href="../../d7/d03/classble_serial.html">bleSerial</a> &amp;ble)</td></tr>
<tr class="separator:a3cbf3bd31cac77037d623ef9c8098a71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a43c9187ddcb7237099ff414b74c5b0bd"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d67/classble_proximity.html#a43c9187ddcb7237099ff414b74c5b0bd">onAlert</a> (uint8_t level)</td></tr>
<tr class="separator:a43c9187ddcb7237099ff414b74c5b0bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a193eb5410fc4cf4b35613ad931ae61ff"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d67/classble_proximity.html#a193eb5410fc4cf4b35613ad931ae61ff">onLinkLoss</a> (uint8_t level)</td></tr>
<tr class="separator:a193eb5410fc4cf4b35613ad931ae61ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6d3426d21b9182c5b3e135dd783e097d"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d67/classble_proximity.html#a6d3426d21b9182c5b3e135dd783e097d">sendEvent</a> (uint8_t level)</td></tr>
<tr class="separator:a6d3426d21b9182c5b3e135dd783e097d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a177463a01974a439c9f8d90b36cf15e1"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d67/classble_proximity.html#a177463a01974a439c9f8d90b36cf15e1">setTxPowerLevel</a> (int8_t dBm)</td></tr>
<tr class="separator:a177463a01974a439c9f8d90b36cf15e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc2ab90789ee61d11031ce816b3db11c"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d67/classble_proximity.html#adc2ab90789ee61d11031ce816b3db11c">isAvailable</a> ()</td></tr>
<tr class="separator:adc2ab90789ee61d11031ce816b3db11c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26a76c241a4d62d2efdac57d2cfe4c0f"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dac/class_c_object.html#a26a76c241a4d62d2efdac57d2cfe4c0f">isThread</a> ()</td></tr>
<tr class="separator:a26a76c241a4d62d2efdac57d2cfe4c0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="../../de/d67/classble_proximity.html">bleProximity</a> provide "Immediate Alert" and "Link Loss" services. The <a class="el" href="../../de/d67/classble_proximity.html">bleProximity</a> enables proximity monitoring between two devices.<br/>
 See Also:<br/>
 <a href="https://developer.bluetooth.org/TechnologyOverview/Pages/PXP.aspx">Proximity Profile (PXP)</a> </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d5/df3/_2ble_2ble_multiple_2src_2main_8cpp-example.html#_a14">/ble/ble_multiple/src/main.cpp</a>, and <a class="el" href="../../d7/d19/_2ble_2ble_proximity_2src_2main_8cpp-example.html#_a7">/ble/ble_proximity/src/main.cpp</a>.</dd>
</dl></div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a3cbf3bd31cac77037d623ef9c8098a71"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bleProximity::bleProximity </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d7/d03/classble_serial.html">bleSerial</a> &amp;&#160;</td>
          <td class="paramname"><em>ble</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><a class="el" href="../../de/d67/classble_proximity.html">bleProximity</a> constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ble</td><td>is a <a class="el" href="../../d7/d03/classble_serial.html" title="bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...">bleSerial</a> class object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="adc2ab90789ee61d11031ce816b3db11c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool bleProximity::isAvailable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Use isAvailable to check the service whether opened by remote (App). </p>
<dl class="section return"><dt>Returns</dt><dd>true, if service is available. otherwise, the service is not in used. </dd></dl>

</div>
</div>
<a class="anchor" id="a26a76c241a4d62d2efdac57d2cfe4c0f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool CObject::isThread </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Check current object that inherits from <a class="el" href="../../d0/d26/class_c_thread.html">CThread</a> class or not. </p>
<dl class="section note"><dt>Note</dt><dd>The isTherad() will be override by <a class="el" href="../../d0/d26/class_c_thread.html">CThread</a> class. </dd></dl>

<p>Reimplemented in <a class="el" href="../../d0/d26/class_c_thread.html#ab2513fd0fcad30e2e6605609c91f1984">CThread</a>.</p>

</div>
</div>
<a class="anchor" id="a43c9187ddcb7237099ff414b74c5b0bd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void bleProximity::onAlert </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>level</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>onAlert event is call by BLE task. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">level</td><td>is an uint8_t type value, 0=No Alert, 1=Mild Alert, 2=High Alert, 3-255 reserved. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section remark"><dt>Remarks</dt><dd>The onAlert will be implemented by the <a class="el" href="../../de/d67/classble_proximity.html">bleProximity</a> class. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>The event is defined in the Immediate service of BLE. The Alert Level characteristic is a control point that allows a peer to command this device to alert to a given level. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d5/df3/_2ble_2ble_multiple_2src_2main_8cpp-example.html#a16">/ble/ble_multiple/src/main.cpp</a>, and <a class="el" href="../../d7/d19/_2ble_2ble_proximity_2src_2main_8cpp-example.html#a9">/ble/ble_proximity/src/main.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a193eb5410fc4cf4b35613ad931ae61ff"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void bleProximity::onLinkLoss </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>level</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>onLinkLoss event is call by BLE task. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">level</td><td>is an uint8_t type value, 0=No Alert, 1=Mild Alert, 2=High Alert, 3-255 reserved. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section remark"><dt>Remarks</dt><dd>The onLinkLose will be implemented by the bleProxmity class. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>The event is defined in the Link-Lose service of BLE. The Alert Level characteristic is used to expose the current link loss alert level that is used to determine how the device alerts when the link is lost. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d7/d19/_2ble_2ble_proximity_2src_2main_8cpp-example.html#a10">/ble/ble_proximity/src/main.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a6d3426d21b9182c5b3e135dd783e097d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool bleProximity::sendEvent </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>level</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Send alert event to remote (App). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">level</td><td>is an uint8_t type value to indicate BLE devie alert level. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true, if send alert event successful. otherwise, if send alert event failed. </dd></dl>

</div>
</div>
<a class="anchor" id="a177463a01974a439c9f8d90b36cf15e1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void bleProximity::setTxPowerLevel </td>
          <td>(</td>
          <td class="paramtype">int8_t&#160;</td>
          <td class="paramname"><em>dBm</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>setTxPowerLevel exposes a device’s current transmit power level when in a connection. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">dBm</td><td>is a signed integer and range from +20dBm to -120dBm </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../de/d67/classble_proximity.html">bleProximity</a></li>
    <li class="footer">Generated on Fri Apr 11 2014 23:43:26 for uCXpresso.BLE by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
